#!/bin/bash
for i in hadoop102 hadoop103; do
    echo "========== $i =========="
    #根据传递的日期参数修改配置文件的日期
if [ $# -ge 1 ]
then
        sed -i "/mock.date/c mock.date: $1" /opt/module/data_mocker/application.yml
fi
    ssh $i "cd /opt/module/data_mocker/; java -jar edu2021-mock-2022-06-14.jar >/dev/null 2>&1 &"
done

